using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
	[Serializable]
	public partial class GIAODANModel : ObjModel<GIAODAN>, IModelConverter
	{

		#region Constructor

		public GIAODANModel()
			: base()
		{
		}

		public GIAODANModel(GIAODAN obj)
			: base(obj)
		{
		}

		#endregion

		#region Fields

		private System.Guid? _magiaodan;

		private System.String _tenthanh;

		private System.String _hovatendem;

		private System.String _ten;

		private System.String _dienthoai;

		private System.Guid? _maquocgia;

		private System.Guid? _matinhthanh;

		private System.Guid? _maquanhuyen;

		private System.Guid? _maxaphuong;

		private System.Guid? _magiaophan;

		private System.Guid? _magiaohat;

		private System.Guid? _magiaoxu;

		private System.Guid? _magiaoho;

		private System.Boolean? _gioitinh;

		private System.String _dantoc;

		private System.Guid? _parentid;

		private System.Guid? _motherid;

		private System.String _diachi;

		private System.Int32? _giaodanid;

		private System.String _tencha;

		private System.String _tenme;

		private System.Boolean? _tathe;

		private System.Int32? _ngaysinh;

		private System.Int32? _thangsinh;

		private System.Int32? _namsinh;

		private System.Boolean? _luuso;

		#endregion

		#region Properties

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAGIAODAN
		{
			get
			{
				return _magiaodan;
			}
			set
			{
				_magiaodan = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(500, ErrorMessage= "Value must be under 500 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TENTHANH
		{
			get
			{
				return _tenthanh;
			}
			set
			{
				_tenthanh = value;
			}
		}

		//[Store]
        [Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(500, ErrorMessage= "Value must be under 500 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String HOVATENDEM
		{
			get
			{
				return _hovatendem;
			}
			set
			{
				_hovatendem = value;
			}
		}

		//[Store]
        [Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(100, ErrorMessage= "Value must be under 100 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TEN
		{
			get
			{
				return _ten;
			}
			set
			{
				_ten = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(20, ErrorMessage= "Value must be under 20 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String DIENTHOAI
		{
			get
			{
				return _dienthoai;
			}
			set
			{
				_dienthoai = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAQUOCGIA
		{
			get
			{
				return _maquocgia;
			}
			set
			{
				_maquocgia = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MATINHTHANH
		{
			get
			{
				return _matinhthanh;
			}
			set
			{
				_matinhthanh = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAQUANHUYEN
		{
			get
			{
				return _maquanhuyen;
			}
			set
			{
				_maquanhuyen = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAXAPHUONG
		{
			get
			{
				return _maxaphuong;
			}
			set
			{
				_maxaphuong = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAGIAOPHAN
		{
			get
			{
				return _magiaophan;
			}
			set
			{
				_magiaophan = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAGIAOHAT
		{
			get
			{
				return _magiaohat;
			}
			set
			{
				_magiaohat = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAGIAOXU
		{
			get
			{
				return _magiaoxu;
			}
			set
			{
				_magiaoxu = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAGIAOHO
		{
			get
			{
				return _magiaoho;
			}
			set
			{
				_magiaoho = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Boolean? GIOITINH
		{
			get
			{
				return _gioitinh;
			}
			set
			{
				_gioitinh = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(100, ErrorMessage= "Value must be under 100 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String DANTOC
		{
			get
			{
				return _dantoc;
			}
			set
			{
				_dantoc = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? PARENTID
		{
			get
			{
				return _parentid;
			}
			set
			{
				_parentid = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MOTHERID
		{
			get
			{
				return _motherid;
			}
			set
			{
				_motherid = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1000, ErrorMessage= "Value must be under 1000 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String DIACHI
		{
			get
			{
				return _diachi;
			}
			set
			{
				_diachi = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? GIAODANID
		{
			get
			{
				return _giaodanid;
			}
			set
			{
				_giaodanid = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1000, ErrorMessage= "Value must be under 1000 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TENCHA
		{
			get
			{
				return _tencha;
			}
			set
			{
				_tencha = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1000, ErrorMessage= "Value must be under 1000 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TENME
		{
			get
			{
				return _tenme;
			}
			set
			{
				_tenme = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Boolean? TATHE
		{
			get
			{
				return _tathe;
			}
			set
			{
				_tathe = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? NGAYSINH
		{
			get
			{
				return _ngaysinh;
			}
			set
			{
				_ngaysinh = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? THANGSINH
		{
			get
			{
				return _thangsinh;
			}
			set
			{
				_thangsinh = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? NAMSINH
		{
			get
			{
				return _namsinh;
			}
			set
			{
				_namsinh = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Boolean? LUUSO
		{
			get
			{
				return _luuso;
			}
			set
			{
				_luuso = value;
			}
		}

		#endregion

		#region IModelConverter

		public System.Type Reflector()
		{
			return typeof(GIAODANModel);
		}

		public object GetModel()
		{
			return this;
		}

		#endregion

		#region Overrides of Model<GIAODAN>

		public override void ReverttoModel()
		{
			CreateModel(this);
		}

		public override GIAODAN ReverttoBussiness()
		{
			return CreateBussiness(this);
		}

		#endregion

		#region Operators

		public static implicit operator GIAODANModel(GIAODAN obj)
		{
			return new GIAODANModel(obj);
		}
		public static implicit operator GIAODAN(GIAODANModel obj)
		{
			return obj.ReverttoBussiness();
		}

		#endregion

	}
}
